import { createApp } from 'vue'
import App from '@/App.vue'
//引入element-plus插件与样式
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'
//引入element-plus提供的全部图表组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router';
import pinia from './store';
//引入路由拦截器
import "./permission"
//实例化对象
const app = createApp(App)
console.log(import.meta.env.VITE_APP_BASE_API);

// import 'virtual:svg-icons-register' 
// import axios from 'axios'
// axios({
//     url:'/mock/login',
//     method:'post',
//     data:{
//         username:"test1",
//         password:"1234"
//     }
// })
//将element-push提供的图标注册为全局组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
    // console.log(import.meta.env.VITE_APP_BASE_API);
    
}
//注册路由
app.use(router)
app.use(ElementPlus)
//安装仓库
app.use(pinia)
//将应用挂载到模版上
app.mount("#app")
